From a9ff87335fd15be4a7a637dda1f10efc8fc2e754 Mon Sep 17 00:00:00 2001 From: X! Date: Tue, 28 Dec 2010 19:12:27 +0000 Subject: [PATCH] Add BlockTest unit test --- tests/phpunit/includes/BlockTest.php | 38 ++++++++++++++++++++++++++++ 1 file changed, 38 insertions(+) create mode 100644 tests/phpunit/includes/BlockTest.php diff --git a/tests/phpunit/includes/BlockTest.php b/tests/phpunit/includes/BlockTest.php new file mode 100644 index 0000000000..a4ae047f3b --- /dev/null +++ b/tests/phpunit/includes/BlockTest.php @@ -0,0 +1,38 @@ +addToDatabase(); + $user->setPassword( 'UTBlockeePassword' ); + + $user->saveSettings(); + + $this->block = new Block( 'UTBlockee', 1, 0, + 'Parce que', wfTimestampNow() + ); + + $this->block->insert(); + } + + function testInitializerFunctionsReturnCorrectBlock() { + + $this->assertTrue( $this->block->equals( Block::newFromDB('UTBlockee') ), "newFromDB() returns the same block as the one that was made"); + + $this->assertTrue( $this->block->equals( Block::newFromID( 1 ) ), "newFromID() returns the same block as the one that was made"); + + } + +} + -- 2.20.1